import java.util.Scanner;

public class HomeWork14_06{
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        System.out.print("please enter 2 strings:");
        String str1 = scan.next();
        String str2 = scan.next();
        
        int rslt = DictCheck.checkDictPos(str1, str2);
        if(rslt < 0){
            System.out.println(str1 + " 在字典前边");
        }else if(rslt == 0){
            System.out.println("两个字符串相同");
        }else{
            System.out.println(str2 + " 在字典前边");
        }
    }
}

class DictCheck{
    public static int checkDictPos(String str1, String str2){
        return str1.compareTo(str2);
    }
}